package rpc.proxy;

public class TestMain {

    public static void main(String[] args) throws InstantiationException, IllegalAccessException {
        //实质被代理的对象
        TestService testService = new TestService();
        //初始化代理类对象
        ProxyObject proxyBean = new ProxyObject(testService);
        //获取代理对象
        ITestService iTestService = (ITestService)proxyBean.getProxy();
        //代理对象执行方法
        iTestService.say();
        
        //通过工厂获取代理对象
        ITestService iTestService2 = (ITestService) ProxyFactory.getProxyBean(TestService.class);
        iTestService2.say();
    }

}
